package com.baosight.sczx.zm.ch.service;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.threadlocal.UserSession;
import com.baosight.iplat4j.ep.ServiceEPBase;
import com.baosight.sczx.common.zm.basetools.StaticTools;
import com.baosight.sczx.common.zm.cInterface.Department;
import com.baosight.sczx.common.zm.cInterface.cs.InitialData;
import com.baosight.sczx.zm.cp.domain.ZMCPProfessionalPlan;
/**
 * 旬报
 */
public class ServiceZMCH90 extends ServiceEPBase {
	/**
	 * <p>Function: initLoad</p>
	 * <p>Description: 初始化</p> 
	 */
	@Override
	public EiInfo initLoad(EiInfo inInfo) {
		inInfo.addBlock(EiConstant.resultBlock).set("showCount", "true");//如果不加这个，翻页的统计和显示是错误的 	
		EiInfo outInfo = this.query(inInfo);
		
//		outInfo.addBlock(Department.getInstance().getConstructionUnit("cmes.cp.department", "orgCode", "orgName", false));
//		outInfo.addBlock(Department.getInstance().getMiningDepts("cmes.cp.department", "orgCode", "orgName", false,UserSession.getInSessionProperty("miningCode").toString()));
		return outInfo;
	}
	public EiInfo query(EiInfo inInfo) 
	{
		StaticTools.setQueryParameters(inInfo, "fdPlanType", "一通三防计划", true);
		StaticTools.setQueryParameters(inInfo, "fdPlanStatus", "上报", true);
		String fdMiningId = UserSession.getInSessionProperty("miningCode").toString();
		StaticTools.setQueryParameters(inInfo, "fdMiningId", fdMiningId, true);
		EiInfo outInfo = super.query(inInfo, "ZMCPProfessionalPlan.query", new ZMCPProfessionalPlan());		
//		EiInfo outInfo = super.query(inInfo, "ZMCPProduceplanYt.query", new ZMCPProduceplanYt());
//		outInfo.addBlock(Department.getInstance().getConstructionUnit("cmes.cp.department", "orgCode", "orgName", false));
		outInfo.addBlock(Department.getInstance().getMiningDepts("cmes.cp.department", "orgCode", "orgName", false,UserSession.getInSessionProperty("miningCode").toString()));
//		outInfo.addBlock(Department.getInstance().getConstructionUnit("cmes.cp.department", "orgCode", "orgName", false));//部门
		outInfo.addBlock(InitialData.getInstance().getEiBlockByNo("cmes.ch.planValidateData", true));//验收类型

		outInfo.set("fdMiningName", UserSession.getInSessionProperty("miningCode"));//矿名称的默认值
		
//		outInfo.getBlock("result").set("other", "详细");
		return outInfo;
	}
	
	
	
} 